using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Mvc.Ajax;
using System.Web.Routing;
using System.Text;

namespace CNPC.Controllers
{
    public class ResultController : Controller
    {
        Models.cnpcDataContext db = new CNPC.Models.cnpcDataContext();
        //
        // GET: /Result/    


        [AcceptVerbs("GET")]
        public ActionResult Index(string q)
        {
            return View(from n in db.names
                        where n.name_string.Contains(q) && n.scientific_name != null
                        orderby n.scientific_name
                        select n
                            );
        }

        public ActionResult Index(int? page)
        {
            if (page == null)
            {
                page = 1;                
            }
            return View();
        }
    }
}
